package com.zh.note.huawei.twohundred.统计差异值大于相似值二元组个数;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/8/9 13:36
 * @description: create it
 */
public class Main {
    /**
     * 异或：不同则为1,相同则为0
     * 1 ^ 1 = 0;
     * 1 ^ 0 = 1;
     * 0 ^ 0 = 1；
     * & 与操作符两边的值都为1时，结果为1；
     * 1 & 1 = 1；
     * 1 & 3 = 0；
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // int n = sc.nextInt();
        // int[] nums = new int[n];
        // for (int i = 0; i < n; i++) {
        //     nums[i] = sc.nextInt();
        // }
        int n = 5;
        int[] nums = {3, 5, 2, 8, 4};
        int count = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                int temp1 = nums[i] ^ nums[j];
                int temp2 = nums[i] & nums[j];
                if (temp1 > temp2) {
                    count++;
                }
            }
        }
        System.out.println(count);

    }
}
